home *** CD-ROM | disk | FTP | other *** search
/ IRIX 6.4 Applications 1997 August / SGI IRIX 6.4 Applications 1997 August.iso / dist / mmailp.idb / usr / lib / Zmail / samples / zscript / updateas.zsc.z / updateas.zsc
Encoding:
Text File  |  1997-01-22  |  788 b   |  39 lines

  1. # Sample Z-Script  function: update_as
  2. #              button: Update As...
  3.  
  4. function update_as() {
  5. #%
  6. #       update_as newname
  7. #
  8. # Update the current folder to a new folder name.  Leaves the current
  9. # folder unchanged, and opens the new folder for further processing.
  10. #%
  11.     if $# == 0
  12.     ask -i newname "Update folder as:"
  13.     if $status == -1
  14.         return -1
  15.     endif
  16.     else
  17.     set newname = $1
  18.     endif
  19.     if -e $newname
  20.     ask "Overwrite $newname?"
  21.     if $status
  22.         return $status
  23.     endif
  24.     endif
  25.     if $?deletesave
  26.     builtin delete `builtin :s`
  27.     else
  28.     if $thisfolder =~ */mail/$user
  29.         if ! $?keepsave
  30.         builtin delete `builtin :s`
  31.         endif
  32.     endif
  33.     endif
  34.     builtin copy -f * {`builtin :d`} $newname
  35.     builtin close -n
  36.     builtin open $newname
  37. }
  38. button -n "Update As..." update_as
  39.